package com.wly.gpb {
	import com.netease.protobuf.*;
	use namespace com.netease.protobuf.used_by_generated_code;
	import com.netease.protobuf.fieldDescriptors.*;
	import flash.utils.Endian;
	import flash.utils.IDataInput;
	import flash.utils.IDataOutput;
	import flash.utils.IExternalizable;
	import flash.errors.IOError;
	// @@protoc_insertion_point(imports)

	// @@protoc_insertion_point(class_metadata)
	public dynamic final class Hero extends com.netease.protobuf.Message {
		/**
		 *  @private
		 */
		public static const ID:FieldDescriptor$TYPE_INT32 = new FieldDescriptor$TYPE_INT32("com.wly.gpb.Hero.id", "id", (1 << 3) | com.netease.protobuf.WireType.VARINT);

		public var id:int;

		/**
		 *  @private
		 */
		public static const NAME:FieldDescriptor$TYPE_STRING = new FieldDescriptor$TYPE_STRING("com.wly.gpb.Hero.name", "name", (2 << 3) | com.netease.protobuf.WireType.LENGTH_DELIMITED);

		public var name:String;

		/**
		 *  @private
		 */
		public static const LEVEL:FieldDescriptor$TYPE_INT32 = new FieldDescriptor$TYPE_INT32("com.wly.gpb.Hero.level", "level", (4 << 3) | com.netease.protobuf.WireType.VARINT);

		public var level:int;

		/**
		 *  @private
		 */
		public static const EXP:FieldDescriptor$TYPE_INT32 = new FieldDescriptor$TYPE_INT32("com.wly.gpb.Hero.exp", "exp", (5 << 3) | com.netease.protobuf.WireType.VARINT);

		public var exp:int;

		/**
		 *  @private
		 */
		public static const LEADERTALENT:FieldDescriptor$TYPE_INT32 = new FieldDescriptor$TYPE_INT32("com.wly.gpb.Hero.leaderTalent", "leaderTalent", (6 << 3) | com.netease.protobuf.WireType.VARINT);

		public var leaderTalent:int;

		/**
		 *  @private
		 */
		public static const ATTACKTALENT:FieldDescriptor$TYPE_INT32 = new FieldDescriptor$TYPE_INT32("com.wly.gpb.Hero.attackTalent", "attackTalent", (7 << 3) | com.netease.protobuf.WireType.VARINT);

		public var attackTalent:int;

		/**
		 *  @private
		 */
		public static const STRENGTHTALENT:FieldDescriptor$TYPE_INT32 = new FieldDescriptor$TYPE_INT32("com.wly.gpb.Hero.strengthTalent", "strengthTalent", (8 << 3) | com.netease.protobuf.WireType.VARINT);

		public var strengthTalent:int;

		/**
		 *  @private
		 */
		public static const TENACITYTALENT:FieldDescriptor$TYPE_INT32 = new FieldDescriptor$TYPE_INT32("com.wly.gpb.Hero.tenacityTalent", "tenacityTalent", (9 << 3) | com.netease.protobuf.WireType.VARINT);

		public var tenacityTalent:int;

		/**
		 *  @private
		 */
		public static const SPEEDTALENT:FieldDescriptor$TYPE_INT32 = new FieldDescriptor$TYPE_INT32("com.wly.gpb.Hero.speedTalent", "speedTalent", (10 << 3) | com.netease.protobuf.WireType.VARINT);

		public var speedTalent:int;

		/**
		 *  @private
		 */
		public static const SOLDIERNUM:FieldDescriptor$TYPE_INT32 = new FieldDescriptor$TYPE_INT32("com.wly.gpb.Hero.soldierNum", "soldierNum", (11 << 3) | com.netease.protobuf.WireType.VARINT);

		public var soldierNum:int;

		/**
		 *  @private
		 */
		public static const SOLDIERMAXNUM:FieldDescriptor$TYPE_INT32 = new FieldDescriptor$TYPE_INT32("com.wly.gpb.Hero.soldierMaxNum", "soldierMaxNum", (12 << 3) | com.netease.protobuf.WireType.VARINT);

		public var soldierMaxNum:int;

		/**
		 *  @private
		 */
		public static const SKILLS:RepeatedFieldDescriptor$TYPE_INT32 = new RepeatedFieldDescriptor$TYPE_INT32("com.wly.gpb.Hero.skills", "skills", (13 << 3) | com.netease.protobuf.WireType.VARINT);

		[ArrayElementType("int")]
		public var skills:Array = [];

		/**
		 *  @private
		 */
		override com.netease.protobuf.used_by_generated_code final function writeToBuffer(output:com.netease.protobuf.WritingBuffer):void {
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 1);
			com.netease.protobuf.WriteUtils.write$TYPE_INT32(output, this.id);
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.LENGTH_DELIMITED, 2);
			com.netease.protobuf.WriteUtils.write$TYPE_STRING(output, this.name);
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 4);
			com.netease.protobuf.WriteUtils.write$TYPE_INT32(output, this.level);
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 5);
			com.netease.protobuf.WriteUtils.write$TYPE_INT32(output, this.exp);
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 6);
			com.netease.protobuf.WriteUtils.write$TYPE_INT32(output, this.leaderTalent);
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 7);
			com.netease.protobuf.WriteUtils.write$TYPE_INT32(output, this.attackTalent);
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 8);
			com.netease.protobuf.WriteUtils.write$TYPE_INT32(output, this.strengthTalent);
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 9);
			com.netease.protobuf.WriteUtils.write$TYPE_INT32(output, this.tenacityTalent);
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 10);
			com.netease.protobuf.WriteUtils.write$TYPE_INT32(output, this.speedTalent);
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 11);
			com.netease.protobuf.WriteUtils.write$TYPE_INT32(output, this.soldierNum);
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 12);
			com.netease.protobuf.WriteUtils.write$TYPE_INT32(output, this.soldierMaxNum);
			for (var skills$index:uint = 0; skills$index < this.skills.length; ++skills$index) {
				com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 13);
				com.netease.protobuf.WriteUtils.write$TYPE_INT32(output, this.skills[skills$index]);
			}
			for (var fieldKey:* in this) {
				super.writeUnknown(output, fieldKey);
			}
		}

		/**
		 *  @private
		 */
		override com.netease.protobuf.used_by_generated_code final function readFromSlice(input:flash.utils.IDataInput, bytesAfterSlice:uint):void {
			var id$count:uint = 0;
			var name$count:uint = 0;
			var level$count:uint = 0;
			var exp$count:uint = 0;
			var leaderTalent$count:uint = 0;
			var attackTalent$count:uint = 0;
			var strengthTalent$count:uint = 0;
			var tenacityTalent$count:uint = 0;
			var speedTalent$count:uint = 0;
			var soldierNum$count:uint = 0;
			var soldierMaxNum$count:uint = 0;
			while (input.bytesAvailable > bytesAfterSlice) {
				var tag:uint = com.netease.protobuf.ReadUtils.read$TYPE_UINT32(input);
				switch (tag >> 3) {
				case 1:
					if (id$count != 0) {
						throw new flash.errors.IOError('Bad data format: Hero.id cannot be set twice.');
					}
					++id$count;
					this.id = com.netease.protobuf.ReadUtils.read$TYPE_INT32(input);
					break;
				case 2:
					if (name$count != 0) {
						throw new flash.errors.IOError('Bad data format: Hero.name cannot be set twice.');
					}
					++name$count;
					this.name = com.netease.protobuf.ReadUtils.read$TYPE_STRING(input);
					break;
				case 4:
					if (level$count != 0) {
						throw new flash.errors.IOError('Bad data format: Hero.level cannot be set twice.');
					}
					++level$count;
					this.level = com.netease.protobuf.ReadUtils.read$TYPE_INT32(input);
					break;
				case 5:
					if (exp$count != 0) {
						throw new flash.errors.IOError('Bad data format: Hero.exp cannot be set twice.');
					}
					++exp$count;
					this.exp = com.netease.protobuf.ReadUtils.read$TYPE_INT32(input);
					break;
				case 6:
					if (leaderTalent$count != 0) {
						throw new flash.errors.IOError('Bad data format: Hero.leaderTalent cannot be set twice.');
					}
					++leaderTalent$count;
					this.leaderTalent = com.netease.protobuf.ReadUtils.read$TYPE_INT32(input);
					break;
				case 7:
					if (attackTalent$count != 0) {
						throw new flash.errors.IOError('Bad data format: Hero.attackTalent cannot be set twice.');
					}
					++attackTalent$count;
					this.attackTalent = com.netease.protobuf.ReadUtils.read$TYPE_INT32(input);
					break;
				case 8:
					if (strengthTalent$count != 0) {
						throw new flash.errors.IOError('Bad data format: Hero.strengthTalent cannot be set twice.');
					}
					++strengthTalent$count;
					this.strengthTalent = com.netease.protobuf.ReadUtils.read$TYPE_INT32(input);
					break;
				case 9:
					if (tenacityTalent$count != 0) {
						throw new flash.errors.IOError('Bad data format: Hero.tenacityTalent cannot be set twice.');
					}
					++tenacityTalent$count;
					this.tenacityTalent = com.netease.protobuf.ReadUtils.read$TYPE_INT32(input);
					break;
				case 10:
					if (speedTalent$count != 0) {
						throw new flash.errors.IOError('Bad data format: Hero.speedTalent cannot be set twice.');
					}
					++speedTalent$count;
					this.speedTalent = com.netease.protobuf.ReadUtils.read$TYPE_INT32(input);
					break;
				case 11:
					if (soldierNum$count != 0) {
						throw new flash.errors.IOError('Bad data format: Hero.soldierNum cannot be set twice.');
					}
					++soldierNum$count;
					this.soldierNum = com.netease.protobuf.ReadUtils.read$TYPE_INT32(input);
					break;
				case 12:
					if (soldierMaxNum$count != 0) {
						throw new flash.errors.IOError('Bad data format: Hero.soldierMaxNum cannot be set twice.');
					}
					++soldierMaxNum$count;
					this.soldierMaxNum = com.netease.protobuf.ReadUtils.read$TYPE_INT32(input);
					break;
				case 13:
					if ((tag & 7) == com.netease.protobuf.WireType.LENGTH_DELIMITED) {
						com.netease.protobuf.ReadUtils.readPackedRepeated(input, com.netease.protobuf.ReadUtils.read$TYPE_INT32, this.skills);
						break;
					}
					this.skills.push(com.netease.protobuf.ReadUtils.read$TYPE_INT32(input));
					break;
				default:
					super.readUnknown(input, tag);
					break;
				}
			}
		}

	}
}
